package com.zj.study.handle;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 赵赳
 * @since: 2021/9/23 9:17
 */
@Configuration
public class ExceptionHandlerConfiguration {

  @Bean
  @ConditionalOnMissingBean
  public GlobalExceptionHandler globalExceptionHandler() {
    return new GlobalExceptionHandler()
        .addHandlers(new ValidationExceptionHandler())
        .addHandlers(new RespExceptionHandler())
        .addHandlers(new ServerWebInputExceptionHandler());
  }

}